<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>Action</title>
    <%@ include file="../../common_header.jsp" %>
    <script type="text/javascript">

    //所有的子窗体都需要有一个save函数，当点击弹出窗体的保存按钮时所进行的操作
    function btnSave_click()
    {
        var fun_ret = false;

       var txt="";
       $('#lstActions option').each(function(i){
           txt=txt + $(this).text()+",";
       });
       $('#action_url').val(txt);
       var vals =$('#formModule').serialize();
       var url = '${ctx }/manage/sysMenus/actionSave';
       $.ajax({
           async: false, 
           type: "POST", 
           url : url,
           data:vals,
           cache:false,
           dataType : 'json', 
           success : function(data) { 
               if(data.success!=0)
               {
                   top.Ext.Msg.alert("提示",data.msg);
               }
               else
               {
                   fun_ret = true;
               }
           } 
       });
       return fun_ret;
    }   
    
    function addUrl()
    {
        var txt=$('#txt_url').val().trim();
        if(txt != "")
        {
            var opt=$("<option>").val(txt).text(txt);
            $('#lstActions').append(opt);
            $('#txt_url').val("");
        }
    }
    //删除列表中选中的项
    function delUrl()
    {
        $('#lstActions').find("option:selected").remove();
    }
    function clearUrl()
    {
        $('#txt_url').val("");
    }
    </script>
  </head>
  <body>
	 <div style="padding:0px">
	     <select id="lstActions" size="4" style="width:240px;height:100px;">
	       <c:forEach items="${actions }" var="au">
	           <option value="${au.actionUrl }">${au.actionUrl }</option>
	       </c:forEach>
	     </select><br/>
	     操作地址：<input type="text" id="txt_url" style="width:176px">
	     <form id="formModule" method="post">
	         <input id="mod_id" type="hidden" name="id" value="${id }">
	         <input id="action_url" type="hidden" name="action_url" value=''>
	     </form>
	     <div style="text-align:center;padding:2px">
	         <a href="javascript:void(0)" class="easyui-linkbutton" onclick="delUrl()">&nbsp;删&nbsp;除&nbsp;</a>
	         <a href="javascript:void(0)" class="easyui-linkbutton" onclick="addUrl()">&nbsp;添&nbsp;加&nbsp;</a>
	         <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearUrl()">&nbsp;清&nbsp;除&nbsp;</a>
	     </div>
	 </div>
  </body>
</html>
